<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <title>心情日记待审核页面</title>
    <%@ include file="../../common/meta.jsp" %>
    <%@ include file="../../common/common-body.jsp" %>
    <link href="${ctx}/css/page/common-list.css?t=${now}" rel="stylesheet">
    <link href="${ctx}/css/page/common-search.css?t=${now}" rel="stylesheet">
    <script src="${ctx}/js/plugins/validate/jquery.validate.custom.js?t=20181024"></script>
    <style>
        /*.form-group{*/
            /*margin-bottom: 25px;*/
        /*}*/
        .modal-body-height{
            height: 375px;
            padding-bottom: 10px;
            overflow-y: auto;
            overflow-x: hidden;
        }
        .overflow-x {
            width:430px;
            height:150px;
            overflow-x: scroll;
            overflow-y: hidden;
        }
        ul .dropdown-menu {
            padding-left: 0px;
            margin-left: 0px;
            float: left;
            text-align: center;
            width: 280px;
        }
        ul{
             list-style: none;
        }
    </style>
</head>
<body class="gray-bg">
<div id="vue">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="tabs-container">
            <ul class="nav nav-tabs">
                <li class="active">
                    <a href="${ctx}/checkMoodDiary/moodDiaryPage" aria-expanded="true">待审核</a>
                </li>
                    <li class="">
                        <a href="${ctx}/checkMoodDiary/moodDiarySuccessPage" aria-expanded="true">已审核</a>
                    </li>
            </ul>
            <div class="row">
                <div class="col-sm-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <h5><i class="fa fa-search"></i> 筛选查询</h5>
                        </div>
                        <div class="ibox-content ibox-content-search">
                            <form class="form-horizontal m-t" id="searchForm" novalidate="novalidate">
                                <div class="form-group">
                                    <label class="col-sm-1 control-label">查询用户：</label>
                                    <div class="col-sm-3">
                                        <input type="text" id="userId" name="userId" onkeydown="if(event.keyCode==13){doRefresh();return false;}"  class="form-control"  placeholder="输入用户ID/昵称" maxlength="30"
                                               value="${not empty bizDiaryDto ? bizDiaryDto.userId : ''}">
                                    </div>

                                    <label class="col-sm-1 control-label">提交时间：</label>
                                    <div class="col-sm-3">
                                        <input placeholder="提交时间" value="${not empty bizDiaryDto ? bizDiaryDto.diaryDate : ''}" class="form-control layer-date" id="diaryDate" name="diaryDateStr">
                                    </div>


                                    <div class="ibox-tools ibox-tools-search">
                                        <button type="button" class="btn btn-primary btn-outline" onclick="doRefresh()">查询</button>
                                        <button type="button" class="btn btn-primary btn-outline" onclick="doReset()">重置</button>
                                        <button type="button" class="btn btn-primary btn-outline" onclick="openSearchTools();"><i class="fa fa-caret-down"></i></button>
                                    </div>
                                </div>
                                <div class="search-tools">
                                    <div class="form-group">
                                        <label class="col-sm-1 control-label">日记内容：</label>
                                        <div class="col-sm-3">
                                            <input type="text" id="contents" name="contents" onkeydown="if(event.keyCode==13){doRefresh();return false;}"  class="form-control"  placeholder="请输入日记内容" maxlength="30"
                                                   value="${not empty bizDiaryDto ? bizDiaryDto.contents : ''}">
                                        </div>

                                        <label class="col-sm-1 control-label">心情：</label>
                                        <div class="col-sm-3">
                                            <ul style="padding-left:0px">
                                                <li class="dropdown" >
                                                    <a style="color: #3d4d5d;"  data-toggle="dropdown" href="#">
                                                        <input id="hiddenMood" type="hidden" />
                                                        <div id="inputDiv">
                                                            <select class="form-control" name="mood" id="mood">
                                                                <option style="color: inherit" value="">--请选择--</option>
                                                            </select>
                                                        </div>
                                                            <%--<span>点击选择心情</span>--%>
                                                            <%--<input id="hiddenMood" type="hidden" />--%>
                                                        <div id="imgDiv">
                                                            <img id="moodImg" name="moodImg" src="${ctx}/images/common/laugh.png" style="width: 40px;height: 40px;" class="gallery-pic" >
                                                        </div>
                                                    </a>
                                                    <ul class="dropdown-menu">
                                                        <c:forEach items="${moodMap}" var="item">
                                                        <li>
                                                            <div style="width: 280px;margin-left: 0px">
                                                                <img src="${ctx}/images/common/${item.key}.png" style="width: 40px;height: 40px;" class="gallery-pic" onclick="selectMood('${item.key}')">
                                                            </div>
                                                        </li>
                                                        </c:forEach>
                                                    </ul>
                                                </li>
                                            </ul>
                                        </div>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <h5><i class="fa fa-table"></i> 审核信息</h5>
                            <div class="ibox-tools col-sm-offset-2">
                                <c:if test="${userType == 'super' || not empty btnMap['checkDiary']}">
                                    <button class="btn btn-primary btn-outline" onclick="openCheckDiaryPage('edit')">审核</button>
                                </c:if>
                                <button class="btn btn-primary btn-outline" onclick="doRefresh()">刷新</button>
                            </div>
                        </div>
                        <div class="ibox-content">
                            <table class='table table-striped table-hover'
                                   id="dataTable" data-height="370"
                                   data-toggle="table"
                                   data-url="${ctx}/checkMoodDiary/pageFindDiaryCheckData?t=${now}"
                                   data-pagination="true"
                                   data-side-pagination="server"
                                   data-striped="true"
                                   data-response-handler="handleServerResult"
                                   data-query-params-type=""
                                   data-query-params="getParams"
                                   data-page-number="${not empty defLogInfo.pageNo ? defLogInfo.pageNo : 1}"
                                   data-page-size="${not empty defLogInfo.pageSize ? defLogInfo.pageSize : defaultPageSize}"
                                   data-page-list="${pageList}">
                                <thead>
                                <tr>
                                    <th data-field="id" data-visible="false">主键id</th>
                                    <th data-field="userId" data-align="center" data-width="120px">用户ID</th>
                                    <th data-field="name" data-align="center" data-width="100px">用户昵称</th>
                                    <th data-field="contents"  data-align="center" data-formatter="formatName" data-events="actionEvents" data-width="120px">日记内容</th>
                                    <th data-field="exoteric" data-visible="false">是否公开</th>
                                    <th data-field="gmtCreate" data-formatter="formatTime"  data-align="center" data-width="120px">提交时间</th>
                                    <th data-field="dataStatus" data-visible="false">数据状态</th>
                                    <th data-field="mood" data-formatter="formatMood"  data-align="center" data-width="180px">心情</th>
                                </tr>
                                </thead>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-12">
                    <div class="text-center">${companyName}</div>
                </div>
            </div>
        </div>
    </div>
</div>

<script src="${ctx}/js/check/moodDiary/checkMoodDiaryMgr.js?t=${now}"></script>

<div id="checkDiary" class="modal" tabindex="-1" role="dialog" data-backdrop="static" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content animated bounceInRight">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 id="" style="font-weight: normal;">审核日记</h4>
            </div>
            <div class="modal-body modal-body-height">
                <h5 class="page-header page-header-new"><i class="fa fa-file-text"></i>&nbsp;&nbsp;基本信息</h5>
                  <form class="form-horizontal m-t" id="contentForm" name="contentForm" autocomplete="off">
                      <div class="form-group">
                        <label class="col-sm-2 control-label">用户ID：</label>
                        <label class="col-sm-4 control-label control-label-content" name="lab_userId" id="lab_userId"></label>

                        <label class="col-sm-2 control-label">当日心情：</label>
                        <div id="col-sm-4"><div name="lab_mood"  id="lab_mood"></div></div>
                      </div>

                      <div class="form-group">
                          <label class="col-sm-2 control-label">习惯清单：</label>
                          <label class="col-sm-8 control-label control-label-content" name="lab_habitName"  id="lab_habitName" ></label>
                      </div>

                      <div class="form-group">
                          <label class="col-sm-2 control-label">文本内容：</label>
                          <label class="col-sm-8 control-label control-label-content" name="lab_contents"  id="lab_contents" ></label>
                      </div>

                      <div class="form-group">
                          <label class="col-sm-2 control-label">图片内容：</label>
                          <div class="col-sm-10" >
                              <div  class="overflow-x">
                                  <div id="picDiv" style="width: 2000px"></div>
                              </div>
                          </div>
                      </div>
                 </form>
            </div>
                <div class="modal-footer" style="text-align: center;">
                    <button class="btn btn-primary" onclick="checkPassBtn()">通过</button>
                    <button class="btn btn-danger" onclick="unCheckPassBtn()">不通过</button>
                    <button class="btn btn-white" onclick="$('#checkDiary').modal('hide')" >取消</button>
                </div>
            </div>
        </div>
</div>

<div id="checkPassDiary" class="modal" tabindex="-1" role="dialog" data-backdrop="static" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content animated bounceInRight">
            <div class="modal-header text-center">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4>审核通过</h4>
            </div>
            <div class="modal-body modal-body-height" >
                <form class="form-horizontal m-t" id="checkDiaryForm" name="checkDiaryForm" autocomplete="off">
                    <div class="form-group">
                        <h2>确定通过审核吗?</h2>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label control-label-content">将当前日记置顶：</label>
                        <div class="col-sm-7">
                            <label style="padding-top: 7px"><input name="isTop" type="radio"  value="N" checked="checked"/>否</label>
                            <label style="margin-left: 60px;padding-top: 3px"><input name="isTop" type="radio"  value="Y" />是</label>
                        </div>
                    </div>
                    <div id="topDiv">
                        <div class="form-group">
                            <label class="col-sm-3 control-label control-label-content">置顶有效期：</label>
                            <div class="col-sm-7">
                                <input placeholder="置顶有效期" class="form-control layer-date" id="topTime" name="topTime">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label control-label-content">置顶排序：</label>
                            <div class="col-sm-7">
                                <input  id="topSort" class="form-control " name="topSort" isPInteger="true">
                                <span class="help-block m-b-none tip"></span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label control-label-content">健康币奖励：</label>
                        <div class="col-sm-7">
                            <input class="form-control layer-date" id="score" name="score" placeholder="健康币奖励范围：1~10" isPInteger="true">
                            <span class="help-block m-b-none tip"></span>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer" style="text-align: center;">
                <button class="btn btn-primary" onclick="doCheckDiary()">确定</button>
                <button class="btn btn-white" onclick="$('#checkPassDiary').modal('hide')">取消</button>
            </div>
        </div>
    </div>
</div>
<div id="unCheckPassDiary" class="modal" tabindex="-1" role="dialog" data-backdrop="static" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content animated bounceInRight">
            <div class="modal-header text-center">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4>审核不通过</h4>
            </div>
            <div class="modal-body modal-body-height" >
                <div class="row">
                    <div class="col-sm-1 text-right error"></div>
                    <div class="col-sm-11 text-left">请输入审核不通过原因(必填)：</div>
                </div>
                <div class="row">
                    <div class="col-sm-1 text-right"></div>
                    <div class="col-sm-11 text-left">
                        <textarea id="error_textarea" name="error_textarea" cols="30" rows="10" class="form-control"></textarea>
                    </div>
                </div>
            </div>
            <div class="modal-footer" style="text-align: center;">
                <button class="btn btn-primary" onclick="doUnCheckPassDiary()">确定</button>
                <button class="btn btn-white" onclick="$('#unCheckPassDiary').modal('hide')">取消</button>
            </div>
        </div>
    </div>
</div>
</body>
</html>
